﻿#include "QWaiting.h"
#include <QMovie>

QWaiting::QWaiting(QWidget *parent)
	: QDialog(parent)
	, m_Move(NULL)
{
	ui.setupUi(this);
    setAutoFillBackground(true);
    setAttribute(Qt::WA_TranslucentBackground, true);
	//设置透明度
	this->setWindowOpacity(0.9);
	//取消对话框标题
	setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);//设置为对话框风格，并且去掉边框
	setWindowModality(Qt::WindowModal);//设置为模式对话框，同时在构造该对话框时要设置父窗口
    ui.label_2->setStyleSheet("color:#FFFFFF;");
    ui.label->setStyleSheet("background-color: transparent;");
    m_Move = new QMovie(":/res/loading.gif");
	ui.label->setMovie(m_Move);
	ui.label->setScaledContents(true);
	m_Move->start();
}

QWaiting::~QWaiting()
{
	m_Move->stop();
}
